#!/bin/bash

wget https://npm.taobao.org/mirrors/node/v10.15.3/node-v10.15.3-linux-x64.tar.xz

tar -xvf ./node-v10.15.3-linux-x64.tar.xz

rm ./node-v10.15.3-linux-x64.tar.xz

sudo mv node-v10.15.3-linux-x64 /opt/node

sudo echo 'export PATH=$PATH:/opt/node/bin' >> ~/.zshrc

zsh

source ~/.zshrc

node -v



